package com.liujun.io.netty.six.seq;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class TestUserInfo {
	
	
	public static void main(String[] args) throws IOException {
		UserInfo user = new UserInfo();
		
		user.buildUserInfo(100).buildUserInfo("Welcome to Netty");
		
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		
		ObjectOutputStream os = new ObjectOutputStream(bos);
		
		os.writeObject(user);
		
		os.flush();
		
		os.close();
		
		byte[] b = bos.toByteArray();
		
		System.out.println("The JDK serializable lengthis :"+b.length);
		
		bos.close();
		System.out.println("----------------------------------------");
		System.out.println("the byte array serializable length is :" + user.codeC().length);
		
	}

}
